import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import {
  JstSaleOutWarehouseOrder4VO,
  JstSaleOutWarehouseOrder4Form,
  JstSaleOutWarehouseOrder4Query
} from '@/api/jdAndJstSceneClassification/deptGetMaterial/jstSaleOutWarehouseOrder4/types';

/**
 * 查询聚水潭-销售出库单列表
 * @param query
 * @returns {*}
 */
export const listJstSaleOutWarehouseOrder4 = (query?: JstSaleOutWarehouseOrder4Query): AxiosPromise<JstSaleOutWarehouseOrder4VO[]> => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-销售出库单列表
 * 01、定义后端接口
 * @param query
 * @returns {*}
 */
export const listJstSaleOutWarehouseOrder4ByShopName7 = (query?: JstSaleOutWarehouseOrder4Query): AxiosPromise<JstSaleOutWarehouseOrder4VO[]> => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/list-by-shop-name-by-jd-deficiency7',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-销售出库单详细
 * @param id
 */
export const getJstSaleOutWarehouseOrder4 = (id: string | number): AxiosPromise<JstSaleOutWarehouseOrder4VO> => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭-销售出库单
 * @param data
 */
export const addJstSaleOutWarehouseOrder4 = (data: JstSaleOutWarehouseOrder4Form) => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭-销售出库单
 * @param data
 */
export const updateJstSaleOutWarehouseOrder4 = (data: JstSaleOutWarehouseOrder4Form) => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭-销售出库单
 * @param id
 */
export const delJstSaleOutWarehouseOrder4 = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jst/saleOutWarehouseOrder/' + id,
    method: 'delete'
  });
};
